﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Collections.ObjectModel;
using for7raid.vkPlayer;

namespace for7raid.Control
{
    public class ListPositionNoConverter: IMultiValueConverter
    {
        #region Члены IMultiValueConverter

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            MediaItem item = (MediaItem)values[0];
            ObservableCollection<MediaItem> QueueList = (ObservableCollection<MediaItem>)values[1];
            string ret = "";
            var index = QueueList.IndexOf(item);
            if (index > -1)
                ret =  string.Concat("[", index + 1, "]");
            if ((bool)values[2])
                ret = ret + "[S]";
            return ret;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
